{extend name="../../admin/view/main"}
{block name="content"}
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card">
    <div class="layui-card-body padding-left-40">

        <div class="layui-row layui-col-space15 margin-bottom-5">

            <div class="layui-col-xs4 padding-bottom-0 relative">
                <label class=" block">
                    <span class="help-label"><b>提现费率</b> Rate</span>
                    <input name="withdraw_rate"  placeholder="请输入佣金提现费率，默认6%" value="{:sysconf('withdraw_rate')}" class="layui-input">
                    <span class="pull-right absolute" style="top: 40px;right:10px;">%</span>
                </label>
            </div>
            <div class="layui-col-xs12 padding-bottom-0 ">
                <label class=" block">
                    <span class="help-label"><b>佣金结算周期</b></span>
                    <input name="can_jiesuantime"  placeholder="请输入佣金结算周期，默认7天" value="{:sysconf('can_jiesuantime')}" class="layui-input">
                    <span class="pull-right absolute" style="top: 40px;right:10px;">天</span>
                </label>
            </div>

            <div class="layui-col-xs12 padding-bottom-0 margin-top-20">
                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>第一档下限</b> First  MIN</span>
                        <input name="f_min_amount" type="number"  placeholder="请输入第一档下限，默认0" value="{:sysconf('f_min_amount')?:'0'}" class="layui-input">
                    </label>
                </div>

                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>第一档上限</b> First  MAX</span>
                        <input name="f_max_amount"  placeholder="请输入第一档上限，默认2000" value="{:sysconf('f_max_amount')?:'0'}" class="layui-input">
                    </label>
                </div>
                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>一级佣金比例</b> First Rate</span>
                        <input name="f_pre_rate"  placeholder="请输入一级佣金比例，默认0%" value="{:sysconf('f_pre_rate')?:'0'}" class="layui-input">
                        <span class="pull-right absolute" style="top: 40px;right:10px;">%</span>
                    </label>
                </div>

                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>二级佣金比例</b> Second Rate</span>
                        <input name="f_pre_pre_rate"  placeholder="请输入二级佣金比例，默认0%" value="{:sysconf('f_pre_pre_rate')?:'0'}" class="layui-input">
                        <span class="pull-right absolute" style="top: 40px;right:10px;">%</span>
                    </label>
                </div>
            </div>
            <div class="layui-col-xs12 padding-bottom-0 margin-top-20">
                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>第二档下限</b> Second  MIN</span>
                        <input name="s_min_amount" type="number" placeholder="请输入第二档下限，默认2001" value="{:sysconf('s_min_amount')?:'0'}" class="layui-input">
                    </label>
                </div>

                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>第二档上限</b> Second  MAX</span>
                        <input name="s_max_amount"   type="number" placeholder="请输入第一档上限，默认5000" value="{:sysconf('s_max_amount')?:'0'}" class="layui-input">
                    </label>
                </div>
                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>一级佣金比例</b> First Rate</span>
                        <input name="s_pre_rate"  placeholder="请输入一级佣金比例，默认0%" value="{:sysconf('s_pre_rate')?:'0'}" class="layui-input">
                        <span class="pull-right absolute" style="top: 40px;right:10px;">%</span>
                    </label>
                </div>

                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>二级佣金比例</b> Second Rate</span>
                        <input name="s_pre_pre_rate"  placeholder="请输入二级佣金比例，默认0%" value="{:sysconf('s_pre_pre_rate')?:'0'}" class="layui-input">
                        <span class="pull-right absolute" style="top: 40px;right:10px;">%</span>
                    </label>
                </div>
            </div>
            <div class="layui-col-xs12 padding-bottom-0 margin-top-20">
                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>第三档下限</b> Third  MIN</span>
                        <input name="t_min_amount" type="number"  placeholder="请输入第一档下限，默认5001" value="{:sysconf('t_min_amount')?:'0'}" class="layui-input">
                    </label>
                </div>

                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>第三档上限</b> Third  MAX</span>
                        <input name="t_max_amount"  type="number" placeholder="请输入第一档上限，默认2000" value="{:sysconf('t_max_amount')?:'0'}" class="layui-input">
                    </label>
                </div>
                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>一级佣金比例</b> First Rate</span>
                        <input name="t_pre_rate"  placeholder="请输入一级佣金比例，默认0%" value="{:sysconf('t_pre_rate')?:'0'}" class="layui-input">
                        <span class="pull-right absolute" style="top: 40px;right:10px;">%</span>
                    </label>
                </div>

                <div class="layui-col-xs3 padding-bottom-0 relative">
                    <label class=" block">
                        <span class="help-label"><b>二级佣金比例</b> Second Rate</span>
                        <input name="t_pre_pre_rate"  placeholder="请输入二级佣金比例，默认0%" value="{:sysconf('t_pre_pre_rate')?:'0'}" class="layui-input">
                        <span class="pull-right absolute" style="top: 40px;right:10px;">%</span>
                    </label>
                </div>
            </div>
            <div class="layui-col-xs12 padding-bottom-0">
                <label class=" block">
                    <span class="help-label"><b>状态说明</b> Second Rate</span>
                    <textarea name="commission_status_remark"  placeholder="请输入佣金状态说明" class="layui-textarea">{:sysconf('commission_status_remark')?:'状态说明'}</textarea>
                </label>
            </div>
            <div class="layui-col-xs12 padding-bottom-0">
                <label class="relative block">
                    <span class="help-label"><b>提现说明</b> Remark</span>
                    <textarea name="withdraw_remark"  placeholder="请输入佣金提现说明" class="layui-textarea">{:sysconf('withdraw_remark')?:'提现说明'}</textarea>
                </label>
            </div>
            <div class="layui-col-xs12 padding-bottom-0">
                <label class="relative block">
                    <span class="help-label"><b>分销中心规则</b> Remark</span>
                    <textarea name="distribution_agreement" style="height:200px!important" placeholder="请输入分销中心规则" class="layui-textarea">{:sysconf('distribution_agreement')?:'分销中心规则'}</textarea>
                </label>
            </div>
        </div>
    </div>

    <div class="hr-line-dashed"></div>
    <div class="layui-form-item text-center">
        <button id="distribution_agreement123 " class="margin-left-15 layui-btn-xs layui-btn" type="button">预览</button>
        <button class="layui-btn layui-btn-xs" type="submit">保存配置</button>
    </div>
</form>
<script>
    $(function(){
      require(['ckeditor'], function () {
        window.createEditor('[name=distribution_agreement]', {height: 150})
      });

      $('#distribution_agreement123').click( function () {
            var contents = $('[name=distribution_agreement]').val();
            gopreview(contents)
        });
    })
    function gopreview(contents){
        $.ajax({
                url:'/index/index/preview',
                type:'POST',
                data:{
                    'content':contents
                },
                success:function(data){
                    if(data.code == 1){
                        layui.layer.open({
                            type: 1, shade: false, title: '预览',
                            content: '<div class="text-center padding-20"><img src="'+data.data+'" width="200"></div>'
                        });
                    }else{
                        layer.msg(data.info);
                        return false;
                    }
                }
            })
    }
</script>


{/block}
